package edu.del.teamknowledgebase.service.code.impl;


import edu.del.teamknowledgebase.service.code.CodeSendStrategy;
import edu.del.teamknowledgebase.service.email.EmailService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@RequiredArgsConstructor
public class EmailCodeSendStrategy implements CodeSendStrategy {
    private final EmailService emailService;

    @Override
    public boolean sendCode(String receiver, String code) {
        return emailService.sendVerificationCode(receiver, code);
    }

    @Override
    public boolean verifyCode(String receiver, String code) {
        return emailService.verifyCode(receiver, code);
    }

    @Override
    public String getType() {
        return "email";
    }
}
